<extend name="Public:base" />
<block name="header_js">
<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function(){
    var ue = UE.getEditor('inputContent',{
        serverUrl :"{:U('Public/editorMethod')}"
    });
    UE.getEditor('inputEnContent',{
        serverUrl :"{:U('Public/editorMethod')}"
    });
})
</script>

<script type="text/javascript" src="__PUBLIC__/js/calendar.config.js"></script>
<script type="text/javascript" src="__DATA__/static/jq_plugins/iColorPicker/iColorPicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/XYHUploader/XYHUploader.js"></script>

<script type="text/javascript">
$(function () {
	//图片集上传
	$('#picture_urls').XYHUploader({sfile:"img1", 
		furl:"{:U('Public/upload',array('img_flag' => 1))}", 
		burl:"{:U('Public/browseFile', array('stype' => 'picture'))}",
		thide: true,
		thumflag: false,
		oneflag: false
	});

	$('#CK_JumpUrl').click(function(){
            if($(this).prop('checked')) {
                $('#JumpUrlDiv').show();

            }else {
                $('#JumpUrlDiv').hide();
            }
            
     });
	
});





</script>
	
</block>

<block name="content">


	<div class="row row_box">
		<div class="col-lg-12">
			<h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
			添加图片集  
		    </h3>
		</div>
		
	<div class="box_h">

<span class="navbar-text">切换：</span>

	<ul>
		<li class="cnbox"><a href="javascript:volid(0);">中文</a></li>
		<li class="enbox"><a href="javascript:volid(0);">英文</a></li>
	</ul>

</div>	
		
		
	</div>


	<div class="row">
		<div class="col-lg-12">

				<form method='post' class="form-horizontal" id="form_do" name="form_do" action="{:U('add')}">											
                    <!-- CN BOX -->
                    <div class="cn_box">
                        <div class="form-group">
                            <label for="inputTtitle" class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-9">
                                <input type="text" name="title" id="inputTtitle" class="form-control" placeholder="标题" required="required" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputColor" class="col-sm-2 control-label">标题颜色</label>
                            <div class="col-sm-5">
                                <input type="text" name="color" id="inputColor" class="form-control  iColorPicker" placeholder="标题颜色" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputColor" class="col-sm-2 control-label">自定义属性</label>
                            <div class="col-sm-9">
                                <foreach name='flagtypelist' item='v'>
                                    <label class="checkbox-inline"><input type='checkbox' name='flags[]' value='{$key}' <if condition="$key eq B_JUMP">id="CK_JumpUrl"</if> /> {$v}</label>
                                </foreach>
                            </div>
                        </div>
                        <div class="form-group" id="JumpUrlDiv" style="display:none;">
                            <label for="inputJumpurl" class="col-sm-2 control-label">跳转网址</label>
                            <div class="col-sm-9">
                                <input type="text" name="jump_url" id="inputJumpurl" class="form-control" placeholder="跳转网址" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputProName" class="col-sm-2 control-label">所属栏目</label>
                            <div class="col-sm-9">
                                <select name="cid" class="form-control">
                                    <volist name="cate" id="v">
                                        <option value="{$v.id}" <if condition="$pid eq $v['id']">selected="selected"</if>>{$v.delimiter}{$v.name}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="BrowerPicture" class="col-sm-2 control-label">图集</label>
                            <div class="col-sm-9">
                                <textarea name="picture_urls" id="picture_urls" class="form-control" readonly="readonly"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputKeywords" class="col-sm-2 control-label">关键词</label>
                            <div class="col-sm-9">
                                <input type="text" name="keywords" id="inputKeywords" class="form-control" value="" placeholder="多关键词之间用“,”隔开" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputDescription" class="col-sm-2 control-label">摘要</label>
                            <div class="col-sm-9">
                                <textarea name="description" id="inputDescription" class="form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputCopyfrom" class="col-sm-2 control-label">来源</label>
                            <div class="col-sm-9">
                                <input type="text" name="copyfrom" id="inputCopyfrom" class="form-control" value="" placeholder="来源" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputContent" class="col-sm-2 control-label">内容</label>
                            <div class="col-sm-9">
                                <textarea name="content" id="inputContent" style="height: 370px;"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPublishtime" class="col-sm-2 control-label">发布时间</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="publish_time" id="inputPublishtime" value="{:date('Y-m-d H:i:s',time())}">
                                <script type="text/javascript">
                                    Calendar.setup({
                                        weekNumbers: true,
                                        inputField : "inputPublishtime",
                                        trigger    : "inputPublishtime",
                                        dateFormat: "%Y-%m-%d %H:%M:%S",
                                        showTime: true,
                                        minuteStep: 1,
                                        onSelect   : function() {this.hide();}
                                    });
                                </script>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputShorttitle" class="col-sm-2 control-label">权重</label>
                            <div class="col-sm-2">
                                <input type="text" name="point" id="inputPoint" value="100" class="form-control" placeholder="权重" />
                            </div>
                            <div class="col-sm-7">
                                <label class="checkbox-inline">权重用于排序，从大到小，排序优先</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputName" class="col-sm-2 control-label">点击数</label>
                            <div class="col-sm-2">
                                <input type="text" name="click" id="click" class="form-control" value="0" placeholder="点击数" />
                            </div>
                            <div class="col-sm-7">
                                <label class="checkbox-inline"><input type="checkbox" name="clickFlag" value="1" <if condition="C('CFG_CLICK_NUM_INIT') eq 0"> checked="checked"</if> /> 随机生成</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputName" class="col-sm-2 control-label">评论</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="comment_flag" value="1" checked="checked" />允许
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="comment_flag" value="0" />禁止
                                </label>
                            </div>
                        </div>
                    </div>
                    <!-- / CN BOX -->
                    <!-- EN BOX -->
                    <div class="en_box">
                        <div class="form-group">
                            <label for="inputEnTtitle" class="col-sm-2 control-label">英文标题</label>
                            <div class="col-sm-9">
                                <input type="text" name="en_title" id="inputEnTtitle" class="form-control" placeholder="英文标题" required="required" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputEnKeywords" class="col-sm-2 control-label">英文关键词</label>
                            <div class="col-sm-9">
                                <input type="text" name="en_keywords" id="inputEnKeywords" class="form-control" value="" placeholder="多关键词之间用“,”隔开" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputEnDescription" class="col-sm-2 control-label">英文摘要</label>
                            <div class="col-sm-9">
                                <textarea name="en_description" id="inputEnDescription" class="form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputEnCopyfrom" class="col-sm-2 control-label">英文来源</label>
                            <div class="col-sm-9">
                                <input type="text" name="en_copyfrom" id="inputEnCopyfrom" class="form-control" value="" placeholder="来源" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputEnContent" class="col-sm-2 control-label">英文内容</label>
                            <div class="col-sm-9">
                                <textarea name="en_content" id="inputEnContent" style="height: 370px;"></textarea>
                            </div>
                        </div>
                    </div>
                    <!-- / EN BOX -->
					<div class="row margin-botton-large">
						<div class="col-sm-offset-2 col-sm-9">
							<input type="hidden" name="pid" value="{$pid}" />
							<div class="btn-group">
								<button type="submit" class="btn btn-primary"> <i class="glyphicon glyphicon-saved"></i>
									保存
								</button>
								<button type="button" onclick="goUrl('{:U('index')}')" class="btn btn-default"> <i class="glyphicon glyphicon-chevron-left"></i>
									返回
								</button>
							</div>
						</div>
					</div>
				</form>
		</div>
	</div>
</block>
<block name="out_foot">
    <script>
        $(document).ready(function () {
            $('.en_box').hide();
			$('.cnbox').addClass('hover'); //默认给中文加hover
            $('.enbox').click(function () {
                $('.cn_box').hide();
                $('.en_box').show();
			//下面两句是加hover
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');
            });
            $('.cnbox').click(function () {
                $('.cn_box').show();
                $('.en_box').hide();
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');				
            });
        });
    </script>
</block>